Portable electronic devices are commonly used for communication, entertainment, and/or information purposes. Portable electronic devices include devices such as smartphones, cellular phones, mobile communication devices, computers, portable computing devices, mobile computing devices, tablet computers, cameras, video players, audio players, electronic media readers, two-way radios, global positioning satellite (GPS) devices, and/or other types of electronic computing or communication devices, including combinations thereof. Tablet computers and large smartphones often include stylus that can be utilized to interact with the display of the device. A stylus can be made of plastic, metal, or some other rigid or semi-rigid material in the shape of a writing utensil, allowing a user to interact with the display of the device in a more accurate manner than simply using a finger. A stylus can be electronically passive, or it can contain electronics, magnets, and sensors to allow a more accurate and flexible interaction with the device display. For example, the SAMSUNG® NOTE 4 device includes stylus that contains electronics and pressure sensors, and is stored in the housing of the device. The stylus includes a magnet that interacts with the device via a sensor, such as a Hall effect sensor, that allows the device to detect when the stylus is inserted and removed from the device housing.
Portable electronic devices are used in a wide variety of environments that can subject the sensitive components to damage from shock, vibration, impact, external forces, sharp objects, water, dirt, dust, snow, rain, sweat, chemicals, and/or other damaging elements. Protection of an electronic device from water and other liquids while allowing a user to easily access and use an associated stylus is desirable.